package com.zhht.checkcop.service.impl;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zhbc.framework.dao.IBaseDao;
import com.zhbc.framework.service.ABaseServiceImpl;
import com.zhht.checkcop.check.vo.UserVO;
import com.zhht.checkcop.dao.UserDao;
import com.zhht.checkcop.service.UserService;

@Transactional
@Service("userService")
public class UserServiceImpl extends ABaseServiceImpl<UserVO> implements UserService{
	@Autowired
	private UserDao userDao;
	
	
	protected IBaseDao<UserVO> getBaseDao() {
		return userDao;
	}
	
	public UserVO getUserByName(String name) throws Exception {
		Map<String, Object> map = new HashMap<String, Object>();
		map.put("userName", name);
		List<UserVO> list = userDao.selectList(map);
		if (list.size() == 0) {
			return null;
		}
		return list.get(0);
	}
	
}
